﻿<dx:DXWindow 
        xmlns:d="http://schemas.devexpress.com/winfx/2008/xaml/core"  
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" 
        x:Class="SQLQuery.UI.RegistDB"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dx="clr-namespace:DevExpress.Xpf.Core;assembly=DevExpress.Xpf.Core.v11.1"
        Title="新增数据源" Height="281" Width="385" 
        MaxHeight="312" MaxWidth="385"
        Loaded="WindowLoaded"
        xmlns:loc="clr-namespace:SQLQuery.Common"
        xmlns:t="clr-namespace:DBAccessLibrary.Model;assembly=DBAccessLibrary" WindowStartupLocation="CenterScreen" KeyDown="DxWindowKeyDown" xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol" WindowStyle="ToolWindow">
    <Grid>
        <dxlc:LayoutControl Orientation="Vertical">
            <dxlc:LayoutGroup  View="GroupBox" Orientation="Vertical" HorizontalAlignment="Stretch">
                <dxlc:LayoutItem Label="数  据  源：" HorizontalAlignment="Center">
                    <dxe:ComboBoxEdit Height="23" HorizontalAlignment="Left"  Name="cbType" VerticalAlignment="Top" Width="167" 
                  loc:EnumSelectorProperty.EnumType="{x:Type t:DBType}"
                  loc:EnumSelectorProperty.BindingPath="DataSource.ConnectType"
                  Text="{Binding DataSource.ConnectType}" IsTextEditable="False" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="服务器地址：" HorizontalAlignment="Center">
                    <dxe:TextEdit Height="23" HorizontalAlignment="Left"  Name="tbIP" VerticalAlignment="Top" Width="167" 
                 Text="{Binding Path=DataSource.Server,Mode=TwoWay}"/>
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="数据库名称：" HorizontalAlignment="Center">
                    <dxe:TextEdit Height="23" HorizontalAlignment="Left"  Name="tbDBName" VerticalAlignment="Top" Width="167" 
                 Text="{Binding Path=DataSource.DataBase,Mode=TwoWay}"/>
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="用  户  名：" HorizontalAlignment="Center">
                    <dxe:TextEdit Height="23" HorizontalAlignment="Left" Name="tbUserID" VerticalAlignment="Top" Width="167" 
                 Text="{Binding DataSource.UserID}"/>
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="密      码：" HorizontalAlignment="Center">
                    <dxe:PasswordBoxEdit Height="23" HorizontalAlignment="Left"  Name="tbPwd" VerticalAlignment="Top" Width="167" 
                     Password="{Binding DataSource.PassWord,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
                </dxlc:LayoutItem>
            </dxlc:LayoutGroup>
            <dxlc:LayoutGroup  View="GroupBox">
                <dxlc:LayoutItem >
                    <dxe:ButtonEdit Name="btnSubmit"  ShowText="False" AllowDefaultButton="False" Height="23" Width="75">
                        <dxe:ButtonInfo GlyphKind="Custom" Content="确定" ButtonKind="Simple" Click="BtnSubmitClick"/>
                    </dxe:ButtonEdit>
                </dxlc:LayoutItem>
                <dxlc:LayoutItem >
                    <dxe:ButtonEdit Name="btnCanel"  ShowText="False" AllowDefaultButton="False" Height="23" Width="75">
                        <dxe:ButtonInfo GlyphKind="Custom" Content="取消" ButtonKind="Simple" Click="ButtonInfoClick"/>
                    </dxe:ButtonEdit>
                </dxlc:LayoutItem>
            </dxlc:LayoutGroup>
        </dxlc:LayoutControl>
        <!--<Label Content="数  据  源：" Height="28" HorizontalAlignment="Left" Margin="60,32,0,0" Name="label1" VerticalAlignment="Top" />
        <Label Content="用  户  名：" Height="28" HorizontalAlignment="Left" Margin="60,144,0,0" Name="label2" VerticalAlignment="Top" />
        <Label Content="密      码：" Height="28" HorizontalAlignment="Left" Margin="60,177,0,0" Name="label3" VerticalAlignment="Top" />
        <Label Content="数据库名称：" Height="28" HorizontalAlignment="Left" Margin="60,110,0,0" Name="label4" VerticalAlignment="Top" />
        <Label Content="服务器地址：" Height="28" HorizontalAlignment="Left" Margin="60,76,0,0" Name="label5" VerticalAlignment="Top" />

        <dxe:TextEdit Height="23" HorizontalAlignment="Left" Margin="139,77,0,0" Name="tbIP" VerticalAlignment="Top" Width="167" 
                 Text="{Binding Path=DataSource.Server,Mode=TwoWay}"/>
        <dxe:TextEdit Height="23" HorizontalAlignment="Left" Margin="139,111,0,0" Name="tbDBName" VerticalAlignment="Top" Width="167" 
                 Text="{Binding Path=DataSource.DataBase,Mode=TwoWay}"/>
        <dxe:TextEdit Height="23" HorizontalAlignment="Left" Margin="139,145,0,0" Name="tbUserID" VerticalAlignment="Top" Width="167" 
                 Text="{Binding DataSource.UserID}"/>

        <dxe:PasswordBoxEdit Height="23" HorizontalAlignment="Left" Margin="139,179,0,0" Name="tbPwd" VerticalAlignment="Top" Width="167" 
                     Password="{Binding DataSource.PassWord,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"/>
        <dxe:ComboBoxEdit Height="23" HorizontalAlignment="Left" Margin="139,32,0,0" Name="cbType" VerticalAlignment="Top" Width="167" 
                  loc:EnumSelectorProperty.EnumType="{x:Type t:DBType}"
                  loc:EnumSelectorProperty.BindingPath="DataSource.ConnectType"
                  Text="{Binding DataSource.ConnectType}" IsTextEditable="False" />
        <dxe:ButtonEdit Name="btnSubmit" Margin="92,225,196,24" ShowText="False" AllowDefaultButton="False" Height="23" Width="75">
            <dxe:ButtonInfo GlyphKind="Custom" Content="确定" ButtonKind="Simple" Click="btnSubmit_Click"/>
        </dxe:ButtonEdit>
        <dxe:ButtonEdit Name="btnCanel" Margin="214,225,74,24" ShowText="False" AllowDefaultButton="False" Height="23" Width="75">
            <dxe:ButtonInfo GlyphKind="Custom" Content="取消" ButtonKind="Simple" Click="ButtonInfo_Click"/>
        </dxe:ButtonEdit>-->
       
    </Grid>
</dx:DXWindow >
